<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>${title }</title>
 	<link href="${basePath}/static/css/basic.css" rel="stylesheet" type="text/css">
    <link href="${basePath}/static/css/list.css" rel="stylesheet" type="text/css">
    <script  type="text/javascript" src="${basePath}/static/js/jquery.min.js"></script>
    <script  type="text/javascript" src="${basePath}/static/layer/layer.js"></script>
    <link href="${basePath}/static/layer/layer_defined.css" rel="stylesheet" type="text/css">
<style>
	.height{
		height:20px;
		line-height:20px;
	}
	.header{
		width:80%;
		height:50px;
		background:#07a396;
		margin:0 auto;
	}
	.header ul li{
		list-style:none;
		line-height:50px;
		margin-left:10px;
		float:left;
		font-size:16px;
		color:#999;
	}
	.header ul li a{
		color:#FFF;
		
	}
	.header ul li:hover a{
		color:#fec99c;
		font-weight:700;
	}
</style>
</head>
<body>
	<input type="hidden" id="totalCounts" value="${totalCounts}"/>
	<input type="hidden" id="auditType" value="${auditType}"/>
	<input type="hidden" id="startTime" value="<fmt:formatDate value="${auditQuery.startTime}" pattern="yyyy-MM-dd"/>"/>
	<input type="hidden" id="endTime" value="<fmt:formatDate value="${auditQuery.endTime}" pattern="yyyy-MM-dd"/>"/>
	<div class="header">
		<ul><li><a onclick="exportExcel()">导出</a></li></ul>
	</div>
	<div style="width:80%; margin:10px auto;">
   <table style="width:100%; float:left; border-collapse:collapse" cellpadding="0" cellspacing="0">
      <tr>
      <td class="tdLabel_4 height" >姓名</td>
      <td class="tdLabel_4 height">识别码</td>
      <td class="tdLabel_4 height">标示</td>
      <td class="tdLabel_4 height">审核内容</td>
      <td class="tdLabel_4 height">错误类型</td>
      </tr>
      
      <c:forEach items="${auditList}" var="audit">
    
     	 <c:forEach items="${audit.auditErrorMsgList}" var= "errorMsg" varStatus="index">
     	 	<c:choose>
   				<c:when test="${index.count==1}">  
        			<tr>
				      <td rowspan="${fn:length(audit.auditErrorMsgList)}" class="tdLabel_5 height">${audit.patientName}</td>
				      <td rowspan="${fn:length(audit.auditErrorMsgList)}" class="tdLabel_5 height">${audit.mrId}</td>
				      <td rowspan="${fn:length(audit.auditErrorMsgList)}" class="tdLabel_5 height">${audit.inHospitalTime}</td>

				      <td class="tdLabel_5 height">${errorMsg.errorMsg}</td>
				      <td class="tdLabel_5 height">${errorMsg.errorType}</td>
				 	</tr>
  				 </c:when>
   				<c:otherwise> 
  					<tr>
					  <td class="tdLabel_5 height">${errorMsg.errorMsg}</td>
				      <td class="tdLabel_5 height">${errorMsg.errorType}</td>
				 	</tr>
  			 	</c:otherwise>
			</c:choose>
     	 </c:forEach>
      
      </c:forEach>
     
	
     </table>
	 </div>
 <script>
 	function exportExcel(){
 		var totalCounts = $("#totalCounts").val();
 		if(totalCounts==0){
 			layer.alert("审核数据不存在!",{icon:7});
			return;
 		}
 		var auditType=$("#auditType").val();
 		var startTime = $("#startTime").val();
 		var endTime = $("#endTime").val();
 		console.log(totalCounts+"--"+auditType+"--"+startTime+"--="+endTime);
 		
 		window.location.href="${basePath}/audit/exportAuditExcel?startTime="+startTime+"&endTime="+endTime+"&auditType="+auditType+"";
 	}
 </script> 
</body>
</html>
